
import bpy

from 全局控制.Node.节点和插座基类 import bl_节点基类
import Core.bl_UI配色 as UI配色

import engine.initLIB.load_dll as engineLib
import ctypes



engineLib.flexCAPI.f_创建自取材质节点.restype = ctypes.c_bool






class C_Node_自取材质(bl_节点基类.C_Node_基类):
	bl_dname = 'bl_node_自取材质'
	bl_label = '自取材质'
	
	def init(self, context):
		super(C_Node_标量关系运算, self).f_init(context)
		self.inputs.new('C_Socket_F32_Array1D', name='变量A')
		self.inputs.new('C_Socket_F32_Array1D', name='变量B')
		self.outputs.new('C_Socket_I8_Array1D', name='结果')
		self.f_toCPP()

	def f_toCPP(self):
		是否更新 = engineLib.flexCAPI.f_创建自取材质节点(ctypes.c_wchar_p(self.id_data.name), ctypes.c_wchar_p(self.name), self.f_getPyObject());
		if 是否更新 :
			pass
		
	def draw_buttons(self, context, layout):
		pass
		

class C_NODE_MENU_自取材质(bpy.types.Operator):
	bl_idname = 'node.create_node_get_pick_up_material'
	bl_label = '自取材质'
	bl_options = {'REGISTER', 'UNDO'}
	def execute(self, context):
		bpy.ops.node.add_node(type='C_Node_自取材质', use_transform=True)
		return {'FINISHED'}
		










classes = (
	C_Node_自取材质,
	C_NODE_MENU_自取材质,
	
)

def register():
	for c in classes:
		bpy.utils.register_class(c)
		
def unregister():
	for c in classes:
		bpy.utils.unregister_class(c)









